import request from "@/utils/request";

// 分页菜单查询
export function listPageMenus(data) {
  return request({
    url: "/menu/pages",
    method: "get",
    params: data,
  });
}

// 菜单树查询
export function listTreeMenus(data) {
  return request({
    url: "/menu/tree/" + data,
    method: "get",
  });
}

// 新增菜单
export function insertMenu(data) {
  return request({
    url: "/menu",
    method: "post",
    data,
  });
}

// 编辑菜单
export function updateMenu(data) {
  return request({
    url: "/menu",
    method: "put",
    data,
  });
}

// 批量删除菜单
export function deleteMenus(data) {
  return request({
    url: "/menu",
    method: "delete",
    params: data,
  });
}

// 删除菜单
export function deleteMenu(data) {
  return request({
    url: "/menu/" + data,
    method: "delete",
  });
}
